Socket
Socket
Sign inDemoInstall

selderee

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

selderee

Selectors decision tree - choose matching selectors, fast


Version published
Maintainers
1
Created

What is selderee?

The selderee npm package is a tool for processing and transforming selectors. It allows you to parse CSS selectors and then make decisions based on the structure of those selectors. It can be used to filter, modify, or otherwise manipulate selectors programmatically.

What are selderee's main functionalities?

Parsing and transforming selectors

This feature allows you to parse CSS selectors and apply transformations to them. The code sample demonstrates how to create a transformer function that processes a selector and returns it unchanged.

const { builder } = require('selderee');
const myTransformer = builder((decisionMap) => {
  decisionMap.default(decision => decision.selector);
});
const transformedSelector = myTransformer.transform('.my-class > .my-element');

Custom decision functions

This feature enables you to define custom decision functions for specific types of selectors. In the code sample, a decision function is defined to replace 'div' tags with the class '.replaced-div'.

const { builder } = require('selderee');
const myTransformer = builder((decisionMap) => {
  decisionMap.onTag('div', () => '.replaced-div');
  decisionMap.default(decision => decision.selector);
});
const transformedSelector = myTransformer.transform('div > .my-element');

Other packages similar to selderee

Keywords

FAQs

Package last updated on 10 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc